package com.atguigu.lease.web.service.impl;

import com.atguigu.lease.web.vo.user.UserInfoQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.lease.model.entity.UserInfo;
import com.atguigu.lease.web.service.UserInfoService;
import com.atguigu.lease.web.mapper.UserInfoMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
* @author liubo
* @description 针对表【user_info(用户信息表)】的数据库操作Service实现
* @createDate 2023-07-24 15:48:00
*/
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
    implements UserInfoService{

    @Override
    public void customQueryPage(Page<UserInfo> page, UserInfoQueryVo queryVo) {
        LambdaQueryWrapper<UserInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(StringUtils.isNotEmpty(queryVo.getPhone()), UserInfo::getPhone, queryVo.getPhone());
        queryWrapper.like(ObjectUtils.isNotEmpty(queryVo.getStatus()), UserInfo::getStatus, queryVo.getStatus());
        this.page(page, queryWrapper);
    }
}




